jQuery(document).ready(function() {
	if (jQuery('#exchange_list').size() > 0) {
		snyc_county_rate();
		setInterval('snyc_county_rate()', 50000);
	}

	if (jQuery('#stock_list').size() > 0) {
		snyc_stock_rate();
		setInterval('snyc_stock_rate()', 60000);
	}
});

function snyc_county_rate() {

	var _url = 'exchange_rate.php?requestid=' + Math.random(1000);
	var params = new Object();
	params['act'] = 'county_rate';

	jQuery.ajax({
		url: _url,
		data: params,
		dataType: 'json',
		success: function(result) {
			//jQuery('#marquees').html(result.content);
			jQuery('#exchange_list').html(result.content);
		}

	});

}

function snyc_stock_rate() {
	//var _url = 'exchange_rate.php?requestid=' + Math.random(1000);
	var _url = 'stock_rate.php?requestid=' + Math.random(1000);
	var params = new Object();
	params['act'] = 'stock_rate';

	jQuery.ajax({
		url: _url,
		data: params,
		dataType: 'text',
		success: function(result) {
			jQuery('#stock_list').html(result);
		}

	});

}

